package factory.one.entity;

import factory.one.pojo.StageVO;

import java.util.Date;

/**
 * @author sk.z
 * 2023/6/26
 * 订单
 **/
public class Order {

    private Long id;
    private String code; //订单编码
    private Long customId; //客户ID
    private Long contractAmount; //合同金额
    private Long actualAmount; //实收金额
    private Integer orderNum; //订单数量
    private Integer produceNum; //生产数量
    private Integer sendNum; //发货数量
    private Integer refundNum; //退货数量
    private Boolean isConfirm; //确认(上线生产)
    private String createUser; //创建用户
    private Date createTime; //创建时间
    private Integer status; //0-删除 1-正常

    //for view
    private String customName; //前端展示
    private Integer produceGap; //生产缺口
    private Integer sendGap; //发送缺口
    private Integer stage; //1-开单(红) 2-确认上线(橙) 3-生产中(绿) 4-交付完成(灰)

    private StageVO[] stages;

    public static final String CREATE_SQL = "    create table \"ORDER\" (\n" +
            "        ID bigint not null GENERATED ALWAYS AS IDENTITY,\n" +
            "        CODE varchar(32) not null,\n" +
            "        CUSTOM_ID bigint not null,\n" +
            "        CONTRACT_AMOUNT bigint not null default 0,\n" +
            "        ACTUAL_AMOUNT bigint not null default 0,\n" +
            "        ORDER_NUM int not null default 0,\n" +
            "        PRODUCE_NUM int not null default 0,\n" +
            "        SEND_NUM int not null default 0,\n" +
            "        REFUND_NUM int not null default 0,\n" +
            "        IS_CONFIRM boolean not null default false,\n" +
            "        CREATE_USER varchar(32) not null,\n" +
            "        CREATE_TIME timestamp not null,\n" +
            "        STATUS int default 1,\n" +
            "        primary key (ID)\n" +
            "    )";

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Long getCustomId() {
        return customId;
    }

    public void setCustomId(Long customId) {
        this.customId = customId;
    }

    public Long getContractAmount() {
        return contractAmount;
    }

    public void setContractAmount(Long contractAmount) {
        this.contractAmount = contractAmount;
    }

    public Long getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(Long actualAmount) {
        this.actualAmount = actualAmount;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getProduceNum() {
        return produceNum;
    }

    public void setProduceNum(Integer produceNum) {
        this.produceNum = produceNum;
    }

    public Integer getSendNum() {
        return sendNum;
    }

    public void setSendNum(Integer sendNum) {
        this.sendNum = sendNum;
    }

    public Integer getRefundNum() {
        return refundNum;
    }

    public void setRefundNum(Integer refundNum) {
        this.refundNum = refundNum;
    }

    public Boolean getConfirm() {
        return isConfirm;
    }

    public void setConfirm(Boolean confirm) {
        isConfirm = confirm;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public Integer getProduceGap() {
        return produceGap;
    }

    public void setProduceGap(Integer produceGap) {
        this.produceGap = produceGap;
    }

    public Integer getSendGap() {
        return sendGap;
    }

    public void setSendGap(Integer sendGap) {
        this.sendGap = sendGap;
    }

    public Integer getStage() {
        return stage;
    }

    public void setStage(Integer stage) {
        this.stage = stage;
    }

    public StageVO[] getStages() {
        return stages;
    }

    public void setStages(StageVO[] stages) {
        this.stages = stages;
    }
}
